package com.aqumon.www.service;

import com.aqumon.www.entity.persistent.Script;
import com.aqumon.www.entity.request.jenkins.JobBasicReq;
import com.aqumon.www.entity.request.jenkins.JobCreateReq;
import com.aqumon.www.entity.request.scripts.ScriptCreateReq;
import com.aqumon.www.entity.request.scripts.ScriptDelReq;
import com.aqumon.www.entity.request.scripts.ScriptEditReq;
import com.aqumon.www.entity.response.scrip.ScriptListResp;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * jenkins job 列表 服务类
 * </p>
 *
 * @author aqumon
 * @since 2022-05-19
 */
public interface ScriptService extends IService<Script> {

    /**
     * 创建job（仅QA平台保存，需要在jenkins服务器创建job）
     * @return List<BuildResp>
     * @param scriptCreateReq
     */
    boolean createScript(ScriptCreateReq scriptCreateReq);

    /**
     * 编辑job信息
     *
     * @param scriptEditReq@return boolean
     */
    Script editScript(ScriptEditReq scriptEditReq);

    /**
     * 删除job（慎用，会从jenkins删除job）
     * @return List<BuildResp>
     */
    boolean deleteJob(JobBasicReq jobBasicReq);

    /**
     * 删除job（仅删除平台存储的job）
     * @return List<BuildResp>
     * @param scriptDelReq
     */
    boolean deleteScript(ScriptDelReq scriptDelReq);

    List<ScriptListResp> listAllScripts(Long jenkinsId);
}
